<md-content class="md-padding">



<div ng-repeat="server in servers">
        <div ng-if="server.id==selectedServer" ng-include src="'static/toolbar-server.html'"></div>
        <div  ng-repeat="logline in pfsstatements">

          <md-card ng-if="logline.digest==selectedQuery && server.id==selectedServer">

              <md-card-content>
                <md-button class="md-raised" aria-label="Tabular" ng-click="closeExplain()">
                  <md-icon  md-menu-origin class="fa fa-close"></md-icon></md-button> Explain Query:
              </md-card-content>
              <div>
                {{logline.query}}
              </div>
              <BR><BR>
            </md-card>

          </div>
          <div  ng-repeat="logline in slowqueries">

            <md-card ng-if="logline.digest==selectedQuery && server.id==selectedServer">

                <md-card-content>
                  <md-button class="md-raised" aria-label="Tabular" ng-click="closeExplain()">
                    <md-icon  md-menu-origin class="fa fa-close"></md-icon></md-button> Explain Query:
                </md-card-content>
                <div>
                  {{logline.query}}
                </div>
                <BR><BR>
              </md-card>

            </div>



         <md-card ng-if="server.id==selectedServer">

             <md-card-content>
               <p  ng-switch="server.state" class="sectionheader">
                 <span ng-switch-when="Master" class="label label-primary">Master   {{server.host}}:{{server.port}}<label
                         ng-if="server.isVirtualMaster==true">-VMaster   {{server.host}}:{{server.port}}</label></span>
                     <span ng-switch-when="Suspect" class="label label-warning">Suspect   {{server.host}}:{{server.port}}<label ng-if="server.isVirtualMaster==true">-VMaster</label></span>
                     <span ng-switch-when="SlaveErr" class="label label-warning">Slave Error   {{server.host}}:{{server.port}}<label
                             ng-if="server.isVirtualMaster==true">-VMaster   {{server.host}}:{{server.port}}</label></span>
                     <span ng-switch-when="StandAlone" class="label label-info">Standalone   {{server.host}}:{{server.port}}<label
                             ng-if="server.isVirtualMaster==true">-VMaster   {{server.host}}:{{server.port}}</label></span>
                     <span ng-switch-default class="label label-default">{{server.state}}  {{server.host}}:{{server.port}}
                         <label ng-if="server.isVirtualMaster==true">-VMaster   {{server.host}}:{{server.port}}</label></span>
              </p>
              </md-card-content>

                   <table border=1 class="slowlog" >
                     <col width="4%"/>
                     <col width="15%"/>
                     <col width="15%"/>
                     <col width="6%"/>
                     <col width="5%"/>
                     <col width="5%"/>
                     <col width="5%"/>
                     <col width="6%"/>
                     <col width="6%"/>
                     <col width="6%"/>


                      <tr>
                         <th align="center">id</th>
                         <th align="center">select_type</th>
                         <th align="center">table</th>
                         <th align="center">type</th>
                         <th align="center">possible_keys</th>
                         <th align="center">key</th>
                         <th align="center">key_len</th>
                         <th align="center">ref</th>
                         <th align="center">rows</th>
                         <th align="center">extra</th>
                      </tr>
                      <tr ng-repeat="logline in explainPlan" >
                         <td class="stamp">{{ logline.id }}</td>
                         <td class="text">{{ logline.selectType.String }}    </td>
                         <td class="text">{{ logline.table.String}} </td>
                         <td class="text">{{ logline.type.String}}</td>
                         <td class="text">{{ logline.possible_keys.String}}</td>
                         <td class="text">{{ logline.key.String }}</td>
                         <td class="text">{{ logline.keyLen.String }}</td>
                         <td class="text">{{ logline.ref.String }}</td>
                         <td class="text">{{ logline.rows.String }}</td>
                         <td class="text">{{ logline.extra.String }}</td>
                      </tr>
                   </table>

             </md-card>
             <BR><BR>
</div>

</md-content>
